---
title: "SQL-002: Retrieve all legacy task codes"
summary: Loads the entire LEGACY_TASK_CODE reference table via an unfiltered SELECT *.
status: draft
owner: SAIF Documentation
last_reviewed: 2026-08-21
library: SAIF.Business.Tasks.Claim
reference_type: embedded
---

# SQL-002 Retrieve all legacy task codes

Loads every row of the `LEGACY_TASK_CODE` reference table on each call; the collection provides read-only access to task-templating metadata used by the legacy task-code lookup.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-002 |
| **Operation type** | Read |
| **Execution method** | Inline SQL |
| **Database** | Oracle |
| **Schema** | `[unqualified]**` |
| **Command type** | Text |
| **Business object** | `clsLegacyTaskCodeCollection` |
| **Criteria property** | `Criteria.RetrieveSQL` |
| **Lifecycle method** | `BeforeRetrieve` / `AfterRetrieve` |

## Parameters

No parameters — the statement has no bind variables.

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [LEGACY_TASK_CODE](../database-tables.md#legacy_task_code) | SELECT | All columns (`SELECT *`); authoritative consumed set is `CREATE_DATE`, `CREATE_USER`, `DATE_DAYS_NUM`, `LEGACY_TASK_CODE`, `NOTEPAD_FLAG`, `TASK_CATEGORY_CODE`, `TEXT_DAYS_NUM`, `TASK_TEXT`, `UPDATE_DATE`, `UPDATE_USER`, `USE_RUNDATE_FLAG` per `clsLegacyTaskCode.Fill`. |

## Sample SQL

```sql
SELECT
  *
FROM legacy_task_code
```

The statement is a single string literal (`"select * from legacy_task_code"`); no `WHERE`, no bind variables, no `ORDER BY` — the entire code table is loaded on every call.*

## Operations and processes
- [Load the legacy task code table](../operations/op-16-load-legacy-task-code-table.md)

## Business rules
- [BR-LTC-01: Legacy task codes are read-only](../business-rules.md#br-ltc-01-legacy-task-codes-are-read-only)

## Sources
- SAIF.Business.Tasks.Claim/clsLegacyTaskCodeCollection.vb
- SAIF.Business.Tasks.Claim/clsLegacyTaskCode.vb
